package com.vector.demo.service.impl;

import com.vector.demo.mapper.StudentMapper;
import com.vector.demo.pojo.Student;
import com.vector.demo.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class StudentServiceImpl implements StudentService {

    @Autowired
    StudentMapper studentMapper;

    @Override
    public Student checkStudent(String name, String pwd) {
        return studentMapper.checkStudent(name,pwd);
    }

    @Override
    @Transactional
    public int addStudent(Student student) {
        return studentMapper.addStudent(student);
    }

    @Override
    @Transactional
    public Student dropStudentById(int s_id) {
        return studentMapper.dropStudentById(s_id);
    }

    @Override
    @Transactional
    public int modifyStudent(Student student) {
        return studentMapper.modifyStudent(student);
    }

    @Override
    public Student selectStudentById(int s_id) {
        return studentMapper.selectStudentById(s_id);
    }

    @Override
    public List<Student> selectAllStudent() {
        return studentMapper.selectAllStudent();
    }
}
